$(document).ready(function(){
	showPro();
});
function getCookie(c_name){
if (document.cookie.length>0)
 {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
   { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
   } 
  }
return ""
}
function showPro(){
	var tempStr = getCookie('swustAddPro');
	var result = '<table width="800" border="1" align = "center"><tr><th scope="col">产品号</th><th scope="col">名称</th><th scope="col">金币</th><th scope="col">爱心币</th><th scope="col">数量</th></tr> <tr>';
	if(tempStr.length > 0){
		t_start = tempStr.indexOf("[");
		while(t_start != -1){
			t_temp = tempStr.indexOf("||",t_start);
			t_end = tempStr.indexOf("||",t_temp + 1);
			t_gp = tempStr.indexOf("||",t_end + 1);
			t_lp = tempStr.indexOf("]",t_gp);
			var proNum = tempStr.substring(t_start + 1,t_temp).replace('[','');
			var title =  tempStr.substring(t_temp + 2,t_end);
			var gPri = tempStr.substring(t_end + 3,t_gp);
			if(gPri < 0)
				gPri = 0;
			var lPri = tempStr.indexOf(t_gp + 3,t_lp);
			if(lPri < 0)
				lPri = 0;
//			alert('proNum:\n' + proNum +  ';gPri:\n' + gPri + ';lPri:\n' + lPri + ";title:\n" + title);
			result += '<td>' + proNum + '</td><td><div align="center">' + title + '</div></td><td><div align="center">' + gPri + '</div></td><td><div align="center">' + lPri + '</div></td><td><div align="center">数量:  <input name=\'number\' id=\'number\' value = \'1\' style="direction:rtl"/></div></td></tr>';
			t_start = tempStr.indexOf("[",t_end);
		}
		result +=  '</table>';
		$("#Product_Cart").html(result);
	}
}